package com_djm_2025_06_04;

public class MyValue {
    public int a ;

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public static void swap(MyValue myValue1, MyValue myValue2) {
        int tmp = myValue1.a;
        myValue1.a = myValue2.a;
        myValue2.a = tmp;
    }

    public static void main(String[] args) {
        MyValue myValue1 = new MyValue();
        MyValue myValue2 = new MyValue();
        myValue1.setA(10);
        myValue2.setA(20);

        System.out.println(myValue1.a);
        System.out.println(myValue2.a);

        System.out.println("-------------------------");

        swap(myValue1,myValue2);

        System.out.println(myValue1.a);
        System.out.println(myValue2.a);
    }
}
